LOCAL_PATH := $(call my-dir)
ANDROID_LIB_PATH = $(LOCAL_PATH)/../../../yt-android-libs

#########################################

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_core
LOCAL_SRC_FILES := $(ANDROID_LIB_PATH)/opencv-prefix/sdk/native/libs/armeabi-v7a/libopencv_core.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_imgproc
LOCAL_SRC_FILES := $(ANDROID_LIB_PATH)/opencv-prefix/sdk/native/libs/armeabi-v7a/libopencv_imgproc.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := opencv_highgui
LOCAL_SRC_FILES := $(ANDROID_LIB_PATH)/opencv-prefix/sdk/native/libs/armeabi-v7a/libopencv_highgui.a
include $(PREBUILT_STATIC_LIBRARY)
#########################################

#########################################


include $(CLEAR_VARS)
LOCAL_MODULE := facetrack
LOCAL_SRC_FILES := $(ANDROID_LIB_PATH)/faceTrackPro/libs/armeabi-v7a/libYTFaceTrackPro.so
#LOCAL_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_SHARED_LIBRARY)
#########################################


include $(CLEAR_VARS)
LOCAL_MODULE := common
LOCAL_SRC_FILES := $(ANDROID_LIB_PATH)/common/libs/armeabi-v7a/libYTCommon.so
#LOCAL_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_SHARED_LIBRARY)
#########################################




include $(CLEAR_VARS)
LOCAL_MODULE := illumination
LOCAL_SRC_FILES := $(ANDROID_LIB_PATH)/YTIllumination/libs/armeabi-v7a/libYTIllumination.so
#LOCAL_C_INCLUDES := $(LOCAL_PATH)
include $(PREBUILT_SHARED_LIBRARY)
#########################################




include $(CLEAR_VARS)
LOCAL_MODULE := faceshapestablizer
LOCAL_SRC_FILES := $(ANDROID_LIB_PATH)/faceTrackPro/libs/armeabi-v7a/libfaceshapestablizer.a
include $(PREBUILT_STATIC_LIBRARY)



#########################################

include $(CLEAR_VARS)
LOCAL_ARM_NEON := true
LOCAL_MODULE := facetrackwrap

LOCAL_C_INCLUDES := \
        $(LOCAL_PATH) \
        $(ANDROID_LIB_PATH)/common/include \
        $(ANDROID_LIB_PATH)/faceTrackPro/include/facetrack \
        $(ANDROID_LIB_PATH)/faceTrackPro/include/ncnn \
        $(ANDROID_LIB_PATH)/YTIllumination/include \
        $(ANDROID_LIB_PATH)/opencv-prefix/sdk/native/jni/include

LOCAL_SHARED_LIBRARIES := facetrack common illumination


LOCAL_STATIC_LIBRARIES := \
        faceshapestablizer \
        opencv_imgproc \
        opencv_core



LOCAL_SRC_FILES :=  facetrack_jni.cpp \
                    FaceTrackDefine.cpp

LOCAL_CFLAGS := -O2  -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math
LOCAL_CPPFLAGS := -O2  -fvisibility-inlines-hidden -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -ffast-math
LOCAL_LDFLAGS += -Wl,--gc-sections

LOCAL_CFLAGS += -fopenmp
LOCAL_CPPFLAGS += -fopenmp
LOCAL_LDFLAGS += -fopenmp

LOCAL_LDLIBS := -lz -llog -ljnigraphics -landroid

include $(BUILD_SHARED_LIBRARY)
#########################################

